home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / src-server / xlisp / xlglob.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-04  |  5.2 KB  |  137 lines

  1. /* -*-C-*-
  2. ********************************************************************************
  3. *
  4. * File:         xlglob.c
  5. * RCS:          $Header: xlglob.c,v 1.6 91/03/24 22:24:47 mayer Exp $
  6. * Description:  xlisp global variables
  7. * Author:       David Michael Betz
  8. * Created:      
  9. * Modified:     Fri Oct  4 04:16:11 1991 (Niels Mayer) mayer@hplnpm
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       X11r5 contrib tape release
  13. *
  14. * WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  15. * XLISP version 2.1, Copyright (c) 1989, by David Betz.
  16. *
  17. * Permission to use, copy, modify, distribute, and sell this software and its
  18. * documentation for any purpose is hereby granted without fee, provided that
  19. * the above copyright notice appear in all copies and that both that
  20. * copyright notice and this permission notice appear in supporting
  21. * documentation, and that the name of Hewlett-Packard and David Betz not be
  22. * used in advertising or publicity pertaining to distribution of the software
  23. * without specific, written prior permission.  Hewlett-Packard and David Betz
  24. * make no representations about the suitability of this software for any
  25. * purpose. It is provided "as is" without express or implied warranty.
  26. *
  27. * HEWLETT-PACKARD AND DAVID BETZ DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  28. * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  29. * IN NO EVENT SHALL HEWLETT-PACKARD NOR DAVID BETZ BE LIABLE FOR ANY SPECIAL,
  30. * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  31. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  32. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  33. * PERFORMANCE OF THIS SOFTWARE.
  34. *
  35. * See ./winterp/COPYRIGHT for information on contacting the authors.
  36. * Please send modifications, improvements and bugfixes to mayer@hplabs.hp.com
  37. * Post XLISP-specific questions/information to the newsgroup comp.lang.lisp.x
  38. *
  39. ********************************************************************************
  40. */
  41. static char rcs_identity[] = "@(#)$Header: xlglob.c,v 1.6 91/03/24 22:24:47 mayer Exp $";
  42.  
  43.  
  44. #include "xlisp.h"
  45.  
  46. #if (defined(UNIX) || defined(WINTERP))
  47. LVAL a_PIPE=NIL;
  48. #endif /* (defined(UNIX) || defined(WINTERP)) */
  49.  
  50. #ifdef WINTERP
  51.  
  52. /* additional type names for winterp*/
  53. LVAL a_XtAccelerators=NIL, a_XtTranslations=NIL, a_XEvent=NIL, a_Window=NIL,
  54.   a_Pixel=NIL, a_Pixmap=NIL, a_XImage=NIL, a_XmString=NIL, a_XmFontList=NIL,
  55.   a_XT_RESOURCE=NIL, a_CALLBACKOBJ=NIL, a_TIMEOUTOBJ=NIL, a_PIXMAP_REFOBJ=NIL,
  56.   a_WIDGETOBJ=NIL, a_EVHANDLEROBJ=NIL;
  57.  
  58. /* A vector that is marked so that winterp objects referenced inside MOTIF
  59.    or Xtoolkit code don't get garbage collected (see w_savedobjs.c) */
  60. LVAL v_savedobjs=NIL;
  61.  
  62. #endif
  63.  
  64. /* symbols */
  65. LVAL true=NIL,obarray=NIL;
  66. LVAL s_unbound=NIL,s_dot=NIL;
  67. LVAL s_quote=NIL,s_function=NIL;
  68. LVAL s_bquote=NIL,s_comma=NIL,s_comat=NIL;
  69. LVAL s_evalhook=NIL,s_applyhook=NIL,s_tracelist;
  70. LVAL s_lambda=NIL,s_macro=NIL;
  71. LVAL s_stdin=NIL,s_stdout=NIL,s_stderr=NIL,s_debugio=NIL,s_traceout=NIL;
  72. LVAL s_rtable=NIL;
  73. LVAL s_tracenable=NIL,s_tlimit=NIL,s_breakenable=NIL;
  74. LVAL s_setf=NIL,s_car=NIL,s_cdr=NIL,s_nth=NIL,s_aref=NIL,s_get=NIL;
  75. LVAL s_svalue=NIL,s_sfunction=NIL,s_splist=NIL;
  76. LVAL s_eql=NIL,s_gcflag=NIL,s_gchook=NIL;
  77. LVAL s_ifmt=NIL,s_ffmt=NIL;
  78. LVAL s_1plus=NIL,s_2plus=NIL,s_3plus=NIL;
  79. LVAL s_1star=NIL,s_2star=NIL,s_3star=NIL;
  80. LVAL s_minus=NIL,s_printcase=NIL;
  81.  
  82. /* keywords */
  83. LVAL k_test=NIL,k_tnot=NIL;
  84. LVAL k_wspace=NIL,k_const=NIL,k_nmacro=NIL,k_tmacro=NIL;
  85. LVAL k_sescape=NIL,k_mescape=NIL;
  86. LVAL k_direction=NIL,k_input=NIL,k_output=NIL;
  87. LVAL k_start=NIL,k_end=NIL,k_1start=NIL,k_1end=NIL;
  88. LVAL k_2start=NIL,k_2end=NIL,k_count=NIL,k_key=NIL;
  89. LVAL k_verbose=NIL,k_print=NIL;
  90. LVAL k_upcase=NIL,k_downcase=NIL;
  91.  
  92. /* lambda list keywords */
  93. LVAL lk_optional=NIL,lk_rest=NIL,lk_key=NIL,lk_aux=NIL;
  94. LVAL lk_allow_other_keys=NIL;
  95.  
  96. /* type names */
  97. LVAL a_subr=NIL,a_fsubr=NIL;
  98. LVAL a_cons=NIL,a_symbol=NIL,a_fixnum=NIL,a_flonum=NIL;
  99. LVAL a_string=NIL,a_object=NIL,a_stream=NIL,a_vector=NIL;
  100. LVAL a_closure=NIL,a_char=NIL,a_ustream=NIL;
  101.  
  102. /* evaluation variables */
  103. LVAL **xlstack = NULL,**xlstkbase = NULL,**xlstktop = NULL;
  104. LVAL xlenv=NIL,xlfenv=NIL,xldenv=NIL;
  105.  
  106. /* argument stack */
  107. LVAL *xlargstkbase = NULL;    /* argument stack base */
  108. LVAL *xlargstktop = NULL;    /* argument stack top */
  109. LVAL *xlfp = NULL;        /* argument frame pointer */
  110. LVAL *xlsp = NULL;        /* argument stack pointer */
  111. LVAL *xlargv = NULL;        /* current argument vector */
  112. int xlargc = 0;            /* current argument count */
  113.  
  114. /* exception handling variables */
  115. CONTEXT *xlcontext = NULL;    /* current exception handler */
  116. CONTEXT *xltarget = NULL;    /* target context (for xljump) */
  117. LVAL xlvalue=NIL;        /* exception value (for xljump) */
  118. int xlmask=0;            /* exception type (for xljump) */
  119.  
  120. /* debugging variables */
  121. int xldebug = 0;        /* debug level */
  122. int xlsample = 0;        /* control character sample rate */
  123. int xltrcindent = 0;        /* trace indent level */
  124.  
  125. /* gensym variables */
  126. char gsprefix[STRMAX+1] = { 'G',0 };    /* gensym prefix string */
  127. int gsnumber = 1;        /* gensym number */
  128.  
  129. /* i/o variables */
  130. int xlfsize = 0;        /* flat size of current print call */
  131. FILE *tfp = NULL;        /* transcript file pointer */
  132.  
  133. /* general purpose string buffer */
  134. char buf[STRMAX+1] = { 0 };
  135.  
  136.